<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue 列表渲染</title>
    <script charset="UTF-8" src="js/vue.js"></script>
</head>
<body>
<div id="app">
    <!--循环显示数组-->
    <template v-for="(item,index) of list">
        <div>
            {{item.text}}-----{{index}}
        </div>
        <span>
            {{item.text}}-----{{index}}
        </span>
    </template>
    <!--对象显示循环-->
    <!--<div v-for="(item,key,index) of userInfo">-->
        <!--{{item}}&#45;&#45;&#45;&#45;{{key}}&#45;&#45;&#45;&#45;{{index}}-->
    <!--</div>-->
</div>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            // 循环显示数组
            list:[{
                id:"1",
                text:"hello"
            },{
                id:"2",
                text:"hello2"
            },{
                id:"3",
                text:"hello3"
            },{
                id:"4",
                text:"hello4"
            }]
            // 对象显示循环
            // userInfo:{
            //     name:"dell",
            //     age:28,
            //     gender:"male",
            //     salary:"secret"
            // }
        },
        methods: {}
    });
</script>
</body>
</html>